<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>login</title>
</head>
<body>
  <button id="login-btn">Login</button>
  <script type="module">
    function login() {
      const redirect = new URL(location.href).searchParams.get('redirect') ?? 'index.html';
      location.href = redirect;
    }
    document.getElementById('login-btn').onclick = login;
  </script>
</body>
</html>